package com.lc202310;

/**
 * Description:
 *
 * @Create 2023/10/30 22:35
 * @Version 1.0
 */
public class Solution275 {
    public int hIndex(int[] citations) {
        int length = citations.length;
        int left = 0, right = length - 1;
        while (left <= right) {
            int mid = (left + right) / 2;
            if (citations[mid] >= length - mid) {
                right = mid - 1;
            } else {
                left = mid + 1;
            }
        }
        return length - left;
    }
}
